<?php

	defined( '_JEXEC' ) or die( 'Restricted Access' );
	require_once ('components/com_yarbb/assets/ybbeditor/ybbeditor.php');
	$dispclr = $this->theme;
	global $ybbConfig;
	$bbcode = new ybbEditor();
	$userArray = array();
?>
<script language="javascript" type="text/javascript">

function delconfirm( delpath ) {

	var answer = confirm ("<?php echo JText::_('POST_DELETE_CONFIRMATION'); ?>")
	if (answer) {
		window.location= delpath;
	}
}

function submitbutton()
{
	var form = document.FrmPostlist;

	var text='';
    text= document.getElementById("post_text").value;
	if (text == '') {
		alert ( "<?php echo $this->labels['invalidtext']; ?>");
		return;
	}
	form.task.value="quickReply";
	form.submit();
}
</script>

<form action="<?php echo $this->action; ?>" method="post" name="FrmPostlist" id="FrmPostlist">
  <div class="ybbmaindiv">
    <table class="ybbnormaltable" cellpadding="0" cellspacing="0">
      <tr>
        <td class="ybbtopleft"></td>
        <td class="ybbtopmiddle">&nbsp;<?php echo $ybbConfig->boardname . ' - ' . $this->postlistmodel->getForumName();?> </td>
        <td class="ybbtopright"></td>
      </tr>
      <tr>
        <td class="ybbleftbody"></td>
        <td class="ybbheaderrow"><table class="ybbnormaltable" cellpadding="5" cellspacing="5">
            <tr>
              <td><div id="yarbb_menu">
                <ul id="ybbmenu">
                  <?php echo $this->userprofile['home']; ?>
                  <li class="node"><a>Инструменты</a>
                    <ul>
                      <?php echo $this->userprofile['latest']; ?> 
					  <?php echo $this->userprofile['link']; ?> 
					  <?php echo $this->userprofile['mylist']; ?> 
					  <?php echo $this->userprofile['approval']; ?>
                    </ul>
                  </li>
                </ul>
              </div></td>
              <td class="ybbheaderusername"><?php echo JText::_('WELCOME') . ' ' . $this->userprofile['boardusername']; ?></td>
              <td class="ybbheaderavatar"><?php echo $this->userprofile['thumb']; ?></td>
            </tr>
          </table></td>
        <td class="ybbrightbody"></td>
      </tr>
      <?php foreach($this->sticky as $rec) { ?>
      <tr>
        <td class="ybbleftbody"></td>
        <td class="ybbheaderrow"><table class="ybbnormaltable" cellpadding="0" cellspacing="0">
            <tr>
              <td class="ybbtopicicon"><img src="<?php echo YARBB_ASSETS_URL_THEME.'/'.$dispclr; ?>/img/sticky<?php echo $rec->topic_type; ?>.gif" class="ybbiconimg" /></td>
              <td class="ybblinetop"><a href="<?php echo JRoute::_('index.php?option=com_yarbb&view=postlist&forum=' . (int)$rec->forum_id . '&topic=' . (int)$rec->id.'&Itemid=' . $ybbConfig->itemid ); ?>"> <b><?php echo $this->escape($rec->post_subject); ?></b> </a>&nbsp; </td>
              <td class="ybbfrmlast" ><?php
                            if( $rec->post_time != 0 ) {
                                if( $rec->post_user > 0 ) {
                                    if( isset( $userArray[$rec->post_user])) {
                                        $uname = $userArray[$rec->post_user];
                                    } else {
                                        $uname = yarbbHelperConfig::getUserName( $rec->post_user );
                                        $userArray[$rec->post_user] = $uname;
                                    }
                                    $uname = '<a href="'. JRoute::_('index.php?option=com_yarbb&view=myprofile&cid=' . $rec->post_user . '&Itemid=' . $ybbConfig->itemid ) . '">' . $uname . '</a>';
                                } else {
                                    $uname = $rec->post_username;
                                }
                            }
                            echo JText::_('POST_LIST_BY') . '&nbsp;<b>'. $uname . '</b>&nbsp;' . JText::_('POST_LIST_ON') . '&nbsp;' .
								JHTML::_('date', $rec->post_time + $ybbConfig->timeoffset, $ybbConfig->dateformat);
                        ?>
              </td>
            </tr>
          </table></td>
        <td class="ybbrightbody"></td>
      </tr>
      <?php }	?>
      <tr class="ybbtablefooter">
        <td class="ybbbotleft"></td>
        <td class="ybbbotmiddle"></td>
        <td class="ybbbotright"></td>
      </tr>
      <tr>
        <td colspan="3" class="ybbtpkmenu"><table class="ybbnormaltable" cellpadding="0" cellspacing="0">
            <tr>
              <?php if( count($this->items) > 0 ) { ?>
              <td class="ybbtpkmenucol"><?php if( $this->modactions || $this->allowposting ) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . '&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id) . '&post=0&mode=reply&Itemid=' . $ybbConfig->itemid); ?>"> <span><?php echo  $this->labels['postreply']; ?></span> </a>
                <?php }
								if( $ybbConfig->emailsub > 0 && $this->userprofile['user_id'] > 0 ) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=emailsub&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"> <span><?php echo $this->emailsub > 0 ? JText::_('EMAIL_UNSUBSCRIBE') : JText::_('EMAIL_SUBSCRIBE'); ?></span> </a>
                <?php }
								if( $ybbConfig->showfavourites > 0 && $this->userprofile['user_id'] > 0) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=favourite&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"> <span><?php echo ($this->favourite > 0 ? JText::_('YBB_UNFAVOURITE') : JText::_('YBB_FAVOURITE')); ?></span> </a>
                <?php }
							if( $this->modactions ) {
								if( $this->postLock > 0 ) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=postunlock&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"><span><?php echo  $this->labels['postunlock']; ?></span></a>
                <?php } else { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=postlock&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"><span><?php echo  $this->labels['postlock']; ?></span></a>
                <?php } ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id). '&postmove=1' ); ?>"><span><?php echo  $this->labels['postmove']; ?></span></a>
                <?php } ?>
              </td>
              <td class="ybbtpkpages"><?php echo $this->pagination->getPagesLinks(); ?></td>
              <?php } ?>
            </tr>
          </table></td>
      </tr>
      <?php
        $userArray = array();
		foreach ($this->items as $item) {
            if( isset( $userArray[$item->post_user])) {
                $postuser = $userArray[$item->post_user];
            } else {
                $postuser = yarbbHelperConfig::getUserProfile($item->post_user);
                $userArray[$item->post_user] = $postuser;
            }
		?>
      <tr>
        <td colspan="3"><a rel="nofollow" name="ybbp<?php echo $item->id; ?>"></a></td>
      </tr>
      <tr>
        <td class="ybbtopleft"></td>
        <td class="ybbtopmiddle"><span class="ybbdvsubject">&nbsp;<?php echo $this->labels['subject'] . substr($this->escape($item->post_subject),0,70).'..'; ?></span> <span class="ybbdvpostime"><?php echo JHTML::_('date', $item->post_time + $ybbConfig->timeoffset, $ybbConfig->dateformat); ?>&nbsp;</span> </td>
        <td class="ybbtopright"></td>
      </tr>
      <tr>
        <td class="ybbleftbody"></td>
        <td><table class="ybbnormaltable" cellpadding="0" cellspacing="6">
            <tr>
              <td class="ybbuserinfo"><table class="ybbnormaltable" cellpadding="5" cellspacing="0">
                  <tr>
                    <td class="ybbpstusername"><b><?php echo $item->post_user > 0 ? $postuser['username'] : $item->post_username; ?></b></td>
                  </tr>
                  <tr>
                    <td class="ybbpostcenter"><a rel="nofollow" onFocus="blur();" href="<?php echo $postuser['profilelink']; ?>" > <?php echo $postuser['avatar']; ?> </a>
                      <?php if( $item->post_user < 1 ) { echo '<br/>'. JText::_('YBB_GUEST'); } ?>
                    </td>
                  </tr>
                  <?php if ($ybbConfig->showrank  > 0 && $item->post_user > 0 ) { ?>
                  <tr>
                    <td class="ybbpostcenter"><?php echo $postuser['rank_title']; ?></td>
                  </tr>
                  <tr>
                    <td class="ybbpostcenter"><img src="<?php echo YARBB_ASSETS_URL . '/ranks/' . $postuser['rank_image'] ; ?>" /></td>
                  </tr>
                  <?php } ?>
                  <?php if($item->post_user > 0 ) { ?>
                  <tr>
                    <td class="ybbpostuserdetails"><b><?php echo $this->labels['joined']; ?></b>:&nbsp;<?php echo JHTML::_('date', $postuser['registerdate'], $ybbConfig->dateformat); ?><br/>
                      <b><?php echo $this->labels['post']; ?></b>:&nbsp;<?php echo number_format($postuser['post_count']); ?><br/>
                      <b><?php echo $this->labels['location']; ?></b>:&nbsp;<?php echo $postuser['location']; ?> </td>
                  </tr>
                  <?php } ?>
                  <?php if ($ybbConfig->userprofile == 'yarbb' && $item->post_user > 0 ) { ?>
                  <tr>
                    <td class="ybbpostcenter"><span class="ybbposticons">
                      <?php
							                		// if((int)$postuser['showemail'] 	== 1) echo '<img src="' . 'components/com_yarbb/assets/icon_email.gif" height="20" width="20" 	title="' . $postuser['email'] . '"/>&nbsp;';
	if($postuser['www']		<> '') echo '<img src="' . 'components/com_yarbb/assets/icon_www.gif" alt="www" title="' . $postuser['www'] . '" />&nbsp;';
	if($postuser['icq'] 	<> '') echo '<img src="' . 'components/com_yarbb/assets/icon_icq.gif" alt="icq" title="' . $postuser['icq'] . '" />&nbsp;';
	if($postuser['aol'] 	<> '') echo '<img src="' . 'components/com_yarbb/assets/icon_aol.gif" alt="aol" title="' . $postuser['aol'] . '" />&nbsp;';
	if($postuser['msn'] 	<> '') echo '<img src="' . 'components/com_yarbb/assets/icon_msn.gif" alt="msn" title="' . $postuser['msn'] . '" />&nbsp;';
	if($postuser['yahoo'] 	<> '') echo '<img src="' . 'components/com_yarbb/assets/icon_yahoo.gif" alt="yahoo" title="' . $postuser['yahoo'] . '" />&nbsp;';
	if($postuser['jabber'] 	<> '') echo '<img src="' . 'components/com_yarbb/assets/icon_jabber.gif" alt="jabber" title="' . $postuser['jabber'] . '" />&nbsp;';
	if($postuser['skype'] 	<> '') echo '<img src="' . 'components/com_yarbb/assets/icon_skype.gif" alt="skype" height="20" width="20" title="' . $postuser['skype'] . '" />';
						                		?>
                      </span> </td>
                  </tr>
                  <?php } ?>
                </table></td>
              <td class="ybbpostarea"><table class="ybbposttable"  cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div class="ybbkarma">
                        <ul class="ybbkarmapanel">
                          <li class="ybbkarmapanelrpt"><a rel="nofollow" href="<?php echo JRoute::_($this->posturl . 'list&forum=' . $item->forum_id . '&topic=' . $item->topic_id . '&post=' . $item->id . '&postreport=1&Itemid=' . $ybbConfig->itemid); ?>" title="<?php echo JText::_('REPORT_ABUSE'); ?>" ><img src="<?php echo YARBB_ASSETS_URL_THEME.'/'.$dispclr; ?>/img/redo.gif" height="16" width="16" border="0" alt="<?php echo JText::_('REPORT_ABUSE'); ?>" /></a></li>
                          <?php if( $ybbConfig->showkarma > 0  && $item->post_user > 0 ) { ?>
                          <li class="ybbkarmapaneldown"><a rel="nofollow" href="<?php echo JRoute::_($this->posturl . 'list&task=karmaDown&forum=' . $item->forum_id . '&topic=' . $item->topic_id . '&post=' . $item->id . '&post_user=' . $item->post_user); ?>" title="<?php echo JText::_('VOTE_DOWN'); ?>"> <img src="<?php echo YARBB_ASSETS_URL_THEME.'/'.$dispclr; ?>/img/minus.gif" height="16" width="16" border="0" alt="<?php echo JText::_('VOTE_DOWN'); ?>" /> </a></li>
                          <li class="ybbkarmapaneltotal"><?php echo $postuser['karma']; ?></li>
                          <li class="ybbkarmapanelup"><a rel="nofollow" href="<?php echo JRoute::_($this->posturl . 'list&task=karmaUp&forum=' . $item->forum_id . '&topic=' . $item->topic_id . '&post=' . $item->id . '&post_user=' . $item->post_user); ?>" title="<?php echo JText::_('VOTE_UP'); ?>"><img src="<?php echo YARBB_ASSETS_URL_THEME.'/'.$dispclr; ?>/img/plus.gif" height="16" width="16" border="0" alt="<?php echo JText::_('VOTE_UP'); ?>" /> </a></li>
                          <?php } ?>
                        </ul>
                      </div></td>
                  </tr>
                  <tr>
                    <td class="ybbposttextcol"><?php
											if( strlen($item->post_subject) > 70 ) {
												echo  '<u><b>'. $this->labels['subject'] . '<i>'. $this->escape($item->post_subject) . '</i></u></b><br/><br/>';
											}
											if( $ybbConfig->ybbeditor == 'yarbb' ) {
												echo $bbcode->parseContent($item->post_text);
											} else {
												echo $item->post_text;
											}
											$attachments = $this->postlistmodel->getAttachments( $item->id);

											echo $attachments_1;
											if( count($attachments) > 0 ) {
												echo '<br/><br/><div class="attachbox">';
											//	echo '<strong>' . JText::_('ATTACHMENTS') . '</strong>' ;
												
		foreach($attachments as $key => $value)
		{
												
		if ($value[2] == 'jpg' || $value[2] == 'gif' || $value[2] == 'png'){
		echo '<a href="' . YARBB_ASSETS_URL . '/uploads/' . $value[0] . '" target="_blank" >';
		echo '<img src="' . YARBB_ASSETS_URL . '/uploads/' . $value[0] . '" width="170"  alt="'.$value[0].'" /></a>&nbsp;';

		
		}else{

		echo '<br /><img src="' . YARBB_ASSETS_URL_THEME .'/'.$dispclr. '/img/attach.png" alt="" />&nbsp;';
		echo '<a href="' . YARBB_ASSETS_URL . '/uploads/' . $value[0] . '">'. $value[1] . ' [' . (int) ($value[3]/1024) . ' Kb]</a><br />';
		
		}

          if( $value[5] <> '' ) echo ' :: '.$value[5];
		  
	}	 
	echo '</div>';	
		}
?>
                    </td>
                  </tr>
                  <?php if( (isset($item->ip)?$item->ip:'') <> '' ){ ?>
                  <tr>
                    <td class="ybbpostlogip"><small>
                      <?php
												if( $this->modactions ) {
													echo '<img src="'.YARBB_ASSETS_URL_THEME.'/'.$dispclr.'/img/ip.gif" />';
													echo $item->ip;
												} else {
													//echo $this->labels['logip'];
												}
												?>
                      </small> </td>
                  </tr>
                  <?php } ?>
                  <?php if( $ybbConfig->showeditmarkup > 0 && $item->modified_time > 0) { ?>
                  <tr>
                    <td class="ybbpostmod"><?php
											if( $item->modified_by > 0 ) {
												if( isset( $userArray[$item->modified_by])) {
													$modifyuser = $userArray[$item->modified_by];
												} else {
													$modifyuser  = yarbbHelperConfig::getUserProfile($item->modified_by);
													$userArray[$item->modified_by] = $modifyuser;
												}
											} else {
												$modifyuser = $item->post_username;
											}
											echo '<span class="ybbpostmodified">'.$this->labels['lastedit'] . ': ' .
												JHTML::_('date', $item->modified_time + $ybbConfig->timeoffset, $ybbConfig->dateformat) . ' ' .
												$this->labels['lasteditby'] . ' ' . $modifyuser['username'] . ' '.
												$this->labels['lasteditreason'] . ' ' . $item->modified_reason . '</span>' ;
										?>
                    </td>
                  </tr>
                  <?php } ?>
                  <?php if( $postuser['signature'] <> '' ) { ?>
                  <tr>
                    <td class="ybbpostsignature"><?php echo $bbcode->parseContent($postuser['signature']);?> </td>
                  </tr>
                  <?php } ?>
                  <tr>
                    <td class="ybbmodmenu"><?php
										$canedit = false;
										$tdiff = time() - $item->post_time;
										$locktime = $ybbConfig->editgracetime > 0 ? $ybbConfig->editgracetime  : $tdiff + 1;
										if( $this->userprofile['user_id'] == $item->post_user && $tdiff <= $locktime && $this->allowEditing > 0 ) {
											$canedit = true;
										}
									if( $this->modactions || $this->allowposting ) { ?>
                      <a rel="nofollow" class="squarebutton" href="<?php echo JRoute::_($this->posturl . '&forum=' . $item->forum_id . '&topic=' . $item->topic_id . '&post=' . $item->id . '&mode=quote&Itemid=' . $ybbConfig->itemid ); ?>"><span><?php echo  $this->labels['postquote']; ?></span></a>
                      <?php }
									if( $this->modactions || $canedit ) { ?>
                      <a rel="nofollow" class="squarebutton" href="<?php echo JRoute::_($this->posturl . '&forum=' . $item->forum_id . '&topic=' . $item->topic_id . '&post=' . $item->id . '&mode=edit&Itemid='. $ybbConfig->itemid); ?>"><span><?php echo  $this->labels['postedit']; ?></span></a>
                      <?php }
									if( $this->modactions) { ?>
                      <a rel="nofollow" class="squarebutton" href="#" onclick='delconfirm( "<?php echo JRoute::_($this->posturl . 'list&task=deletePost&forum=' . $item->forum_id . '&topic=' . $item->topic_id . '&post=' . $item->id); ?>"); return false;' ><span><?php echo  $this->labels['postdelete']; ?></span></a>
                      <?php if( $item->id != $this->startPost ) { ?>
                      <a rel="nofollow" class="squarebutton" href="<?php echo JRoute::_($this->posturl . 'list&task=postsplit&forum=' . $item->forum_id . '&topic=' . $item->topic_id . '&post=' . $item->id); ?>"><span><?php echo  $this->labels['postsplit']; ?></span></a>
                      <?php }
									}
									if( ($ybbConfig->showquickreply > 0) && ($this->modactions || $this->allowposting ) ) { ?>
                      <a rel="nofollow" class="squarebutton" href="#ybbpquickreply"><span><?php echo  $this->labels['quickreply']; ?></span></a>
                      <?php } ?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
        <td class="ybbrightbody"></td>
      </tr>
      <tr class="ybbtablefooter">
        <td class="ybbbotleft"></td>
        <td class="ybbbotmiddle"></td>
        <td class="ybbbotright"></td>
      </tr>
      <tr>
        <td colspan="3" class="ybbcolspacer"></td>
      </tr>
      <?php	}	?>
      <tr>
        <td colspan="3" class="ybbtpkmenu"><table class="ybbnormaltable" cellpadding="0" cellspacing="0">
            <?php if( count($this->items) > 0 ) { ?>
            <tr>
              <td class="ybbtpkmenucolbot"><?php if( $this->modactions || $this->allowposting ) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . '&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id) . '&post=0&mode=reply&Itemid=' . $ybbConfig->itemid); ?>"> <span><?php echo  $this->labels['postreply']; ?></span> </a>
                <?php } ?>
                <?php if( $ybbConfig->emailsub > 0 && $this->userprofile['user_id'] > 0 ) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=emailsub&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"> <span><?php echo $this->emailsub > 0 ? JText::_('EMAIL_UNSUBSCRIBE') : JText::_('EMAIL_SUBSCRIBE'); ?></span> </a>
                <?php } ?>
                <?php if( $ybbConfig->showfavourites > 0 && $this->userprofile['user_id'] > 0) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=favourite&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"> <span><?php echo ($this->favourite > 0 ? JText::_('YBB_UNFAVOURITE') : JText::_('YBB_FAVOURITE')); ?></span> </a>
                <?php }
							if( $this->modactions ) {
								if( $this->postLock > 0 ) { ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=postunlock&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"><span><?php echo  $this->labels['postunlock']; ?></span></a>
                <?php } else { ?>
                <a class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&task=postlock&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id)); ?>"><span><?php echo  $this->labels['postlock']; ?></span></a>
                <?php } ?>
                <a rel="nofollow" class="ovalbutton" href="<?php echo JRoute::_($this->posturl . 'list&forum=' . ((int)$this->items[0]->forum_id) . '&topic=' . ((int)$this->items[0]->topic_id) .'&postmove=1'); ?>"><span><?php echo  $this->labels['postmove']; ?></span></a>
                <?php } ?>
              </td>
              <td class="ybbtpkpages"><?php echo $this->pagination->getPagesLinks(); ?></td>
            </tr>
            <tr>
              <td></td>
              <td class="ybbtpkpagecount"><?php echo JText::_('PAGE') . ' #&nbsp;'. $this->pagination->getLimitBox(); ?></td>
            </tr>
            <?php } ?>
          </table></td>
      </tr>
      <?php if( ($ybbConfig->showquickreply > 0) && ($this->modactions || $this->allowposting )) { ?>
      <tr>
        <td colspan="3" class="ybbcolspacer"><a rel="nofollow" name="ybbpquickreply"></a></td>
      </tr>
      <tr>
        <td class="ybbtopleft"></td>
        <td class="ybbtopmiddle">&nbsp;<?php echo $this->labels['quickreply']; ?></td>
        <td class="ybbtopright"></td>
      </tr>
      <tr>
        <td class="ybbleftbody"></td>
        <td class="ybbquickreply"><textarea id="post_text" name = "post_text" style="width:100%; height: 150px;" ></textarea>
          <br clear="left" />
          <table class="ybbnormaltable" cellpadding="0" cellspacing="0">
            <tr>
              <?php if( $this->cap_path <> '' ) { ?>
              <td class="ybbeditcaplabel"><strong><?php echo $this->labels['captcha']; ?>:</strong></td>
              <td class="ybbeditcap"><img id="imgcap" name="imgcap" src="<?php echo $this->cap_path;?>"  /></td>
              <td class="ybbeditcaptext"><input class="ybbeditcapinput" type="text" id="captcha" name="captcha" maxlength="5" autocomplete="off"/></td>
              <?php } else {
                                echo '<td colspan="3"><input type="hidden" id="captcha" name="captcha" />&nbsp;</td>';
                            }
                            ?>
              <td><div class="buttonarea"> <a rel="nofollow" class="ovalbutton" href="#" onclick="submitbutton(); return false;"> <span><?php echo $this->labels['save']; ?></span> </a> </div></td>
            </tr>
          </table></td>
        <td class="ybbrightbody"></td>
      </tr>
      <tr class="ybbtablefooter">
        <td class="ybbbotleft"></td>
        <td class="ybbbotmiddle"></td>
        <td class="ybbbotright"></td>
      </tr>
      <?php } ?>
    </table>
  </div>
  <input type="hidden" id="option" name="option" value="com_yarbb" />
  <input type="hidden" id="task" name="task" value="" />
  <input type="hidden" id="id" name="id" value="0" />
  <input type="hidden" id="forum_id" name="forum_id" value="<?php echo ((int)$this->items[0]->forum_id) ; ?>" />
  <input type="hidden" id="topic_id" name="topic_id" value="<?php echo ((int)$this->items[0]->topic_id); ?>" />
  <input type="hidden" id="mode" name="mode" value="reply" />
  <input type="hidden" id="attachid" name="attachid" value="" />
  <input type="hidden" id="username" name="username" value="<?php echo $this->userprofile['username']; ?>" />
  <input type="hidden" id="topic_type" name="topic_type" value="0" />
  <input type="hidden" id="topic_emoticon" name="topic_emoticon" value="0" />
  <input type="hidden" id="post_subject" name="post_subject" value="<?php echo JText::_('POST_REPLY_PREFIX') . $this->items[0]->post_subject; ?>" />
  <input type="hidden" id="autosub" name="autosub" value="<?php echo $ybbConfig->autosub; ?>" />
  <input type="hidden" id="modified_reason" name="modified_reason" value="" />
  <input type="hidden" name="<?php echo JUtility::getToken(); ?>" value="1" />
</form>
<br/>
<br/>
<?php echo YARBB_COPYRIGHT; ?> <br/>
<br/>
